package com.zlg.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zlg.entity.Users;

@Controller
public class thymeleafController2 {
	@RequestMapping("/show4")
	public String showInfo(Model model){
		Map<String,Users> map = new HashMap<>();
		map.put("u1", new Users(1,"张三",20));
		map.put("u2", new Users(2,"李四",22));
		map.put("u3", new Users(3,"王五",233));
		model.addAttribute("map",map);
		return "index4";
	}
	
	@RequestMapping("/show5")
	public String showInfo5(HttpServletRequest request,Model model){
		request.setAttribute("req", "HttpServletRequest111");
		request.getSession().setAttribute("sess", "HttpSession111");
		request.getSession().getServletContext().setAttribute("app","getServletContext111");
		return "index5";
	}
	
	

}
